{config_load file=global.conf}
{config_load file="_rates.conf" section="`$lang`"}
{config_load file="_trader.conf" section="`$lang`"}
{*-----------------------------------------------------------------------------------------------*}
{* Visualisation block *}
{literal}
<script type="text/javascript">
<!--
    function emptyFunc() {
    }

    function showStrobber() {
      xajax.$('strobber').style.display='block';
    } //showStrobber

    function hideStrobber() {
      xajax.$('strobber').style.display='none';
    } //hideStrobber

    function afterBodyLoaded(){
      xajax.loadingFunction = showStrobber;
      xajax.doneLoadingFunction = hideStrobber;
    } //afterBodyLoaded

    addLoadEvent(afterBodyLoaded);

    //---------------------------------------

    function enableInputOpenPrice(flag) {
      var inp = document.getElementById('inputTraderNew_Form__openprice');

      if( flag )
        inp.disabled = '';
      else
        inp.disabled = 'disabled';
      return false;
    } //enableInputOpenPrice

    function setCheckedRadioValue(radioObjName, newValue) {
      var radioObj = document.getElementById(radioObjName);
      if( !radioObj ) return;
      var radioLength = radioObj.length;
      if(radioLength == undefined) {
        radioObj.checked = (radioObj.value == newValue.toString());
        return;
      } //if
      for(var i = 0; i < radioLength; i++) {
        radioObj[i].checked = false;
        if(radioObj[i].value == newValue.toString()) {
          radioObj[i].checked = true;
        } //if
      } //for
    } //setCheckedRadioValue

    function setInputValue(ObjName, newValue) {
      var inputObj = document.getElementById(ObjName);
      if( !inputObj ) return;
      inputObj.value = newValue;
    } //setInputValue

    function setCheckBoxValue(ObjName, newValue) {
      var inputObj = document.getElementById(ObjName);
      if( !inputObj ) return;
      inputObj.checked = newValue;
    } //setCheckBoxValue

// -->
</script>
{/literal}
{* /Visualisation block *}
{*-----------------------------------------------------------------------------------------------*}
{* System Selector *}
<span id="div_form_systemselector" name="div_form_systemselector">
     {$formSystemSelector}
</span>
{assign var="system" value=$smarty.get.system}
{* /System Selector *}
{*-----------------------------------------------------------------------------------------------*}
{* Load CSS & JS *}
<script src="{#scripts_dir#}/script.aculo.us/lib/prototype.js" type="text/javascript"></script>
<script src="{#scripts_dir#}/script.aculo.us/src/scriptaculous.js" type="text/javascript"></script>
<script src="{#scripts_dir#}/script.aculo.us/src/unittest.js" type="text/javascript"></script>

<link href="{#styles_dir#}/loading.css" rel="stylesheet" type="text/css">
<link href="{#styles_dir#}/form.css" rel="stylesheet" type="text/css">
{* /Load CSS & JS *}
{*-----------------------------------------------------------------------------------------------*}
{* Main Area *}
<div id="strobber" style="display:none"><img src="{#images_dir#}/loading.gif">&nbsp;{#page__LoadingLabel#}</div>
<div id="divRates" name="divRates">&#160; </div>
<div id="divTrader">
     <div id="divTraderOpen"> </div>
     <div id="divTraderNew"> </div>
</div>
{* /Main Area *}
{*-----------------------------------------------------------------------------------------------*}
<script type="text/javascript">
<!--

xajax_showLastRates({$Staff->UserID()});
xajax_showTraderOpen('{$system}');
xajax_showTraderNew();

setInterval("xajax_reloadTraderOpen()", 90000); // Auto update trader: open orders
setInterval("xajax_showLastRates({$Staff->UserID()})", 30000); // Auto update currency

// -->
</script>
{*-----------------------------------------------------------------------------------------------*}
